<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" dir="ltr">
#set($title="${subject.title}${subject.category.name}_#foreach($cat in $category.higherLevelList)$cat.name_#end")
#set($description="$utils.description($subject.content,140)")
<head>
#headTag($title $description)
<script type="text/javascript">
img1=new Image();img1.src='${url.base}/static/frs_base.png';img2=new Image();img2.src='${url.base}/static/logo.gif';
thumbImg=function(obj,method){var maxwidth='600';if(!obj){return}obj.onload=null;file=obj.src;zw=obj.offsetWidth;zh=obj.offsetHeight;if(zw<2){if(!obj.id){obj.id='img_'+Math.random()}setTimeout("thumbImg($('#"+obj.id+"')[0], "+method+")",100);return}zr=zw/zh;if(zw>maxwidth){zw=maxwidth;zh=zw/zr;obj.style.cursor='pointer';if(!obj.onclick){obj.title='点击显示正常大小';obj.onclick=function(){window.open(obj.src,'','')}}}obj.width=zw;obj.height=zh}
</script>
</head>
<body>
<div id="page">
#parse("default/_header.htm")
<div id="middle">
<div id="main_wrap">
	<div id="main">
		#topbar($subject.category)

		<div class="topic">
			<h1 class="title">${subject.title}</h1>
			#if($pagination.currentPage==1)
			<div class="content_wrap">
				<span class="floor"><i title="获取地址">楼主</i>
				<a name="subject${subject.id}">&nbsp;</a>
				</span>
				<div class="content">
					#if($subject.hide)
						<span style="color:red;">该主题内容已被管理员隐藏</span>
					#else
						$utils.ubb2html($subject.content)
						#parse("default/_vote_result.htm")
					#end
				</div> 
				#if($subject.author.account.extInfo.signature)
				<div class="sign">$subject.author.account.extInfo.signature</div>
				#end
			</div>
			<div class="info">
				#if($subject.author.id==1)
				<img alt="头像" src="${url.base}#if($subject.author.account.extInfo.photoPath)$subject.author.account.extInfo.photoPath#{else}/static/photo.jpg#end"/>
				<span class="nickname">$utils.ipFormat($subject.ip)</span>
				#else
				<a href="${url.base}/member/${subject.author.id}"><img alt="头像" src="${url.base}#if($subject.author.account.extInfo.photoPath)$subject.author.account.extInfo.photoPath#{else}/static/photo.jpg#end"/></a>
				<a href="${url.base}/member/${subject.author.id}" class="nickname">${subject.author.account.nickname}</a>
				#end
			</div>
			<div class="clear"></div>
			<div class="time">
				$utils.dateFormat("yyyy-MM-dd HH:mm",$subject.dateline)
				<a href="${url.base}/subject/${subject.id}/edit">编辑</a>
				#if($subject.hide)
				<a href="javascript:forum.op.hideSubject(${subject.id},false)">显示内容</a>
				#else
				<a href="javascript:forum.op.hideSubject(${subject.id},true)">隐藏内容</a>
				#end
				<a href="javascript:forum.insertIntoEditor()">回复</a>
			</div>
			#end
			#foreach($reply in $replyList)
			<div class="content_wrap">
				#if($pagination.currentPage==1)
					#set($floor=$foreach.count+1)
				#else
					#set($floor=($pagination.currentPage-1)*15+$foreach.count)
				#end
				<span class="floor"><i title="获取地址">${floor}楼</i>
				<a name="reply${reply.id}">&nbsp;</a>
				</span>
				<div class="content">
						#if($reply.hide)
						<span style="color:orange;">该回复已被管理员隐藏</span>
						#else
						$utils.ubb2html($reply.content)
						#end
				</div>
				#if($reply.author.account.extInfo.signature)
				<div class="sign">${reply.author.account.extInfo.signature}</div>
				#end
			</div>
			<div class="info">
				#if($reply.author.id==1)
				<img alt="头像" src="${url.base}#if($reply.author.account.extInfo.photoPath)$reply.author.account.extInfo.photoPath#{else}/static/photo.jpg#end"/>
				<span class="nickname">$utils.ipFormat($reply.ip)</span>
				#else
				<a href="${url.base}/member/${reply.author.id}"><img alt="头像" src="${url.base}#if($reply.author.account.extInfo.photoPath)$reply.author.account.extInfo.photoPath#{else}/static/photo.jpg#end"/></a>
				<a href="${url.base}/member/${reply.author.id}" class="nickname">${reply.author.account.nickname}</a>
				#end
			</div>
			<div class="clear"></div>
			<div class="time">
				$utils.dateFormat('yyyy-MM-dd HH:mm',$reply.date)
				<a href="javascript:forum.insertIntoEditor('${floor}楼', ${reply.id})">回复</a>
					<a href="${url.base}/reply/${reply.id}/edit">编辑</a>
					<a href="javascript:javascript:if((confirm('确定要删除吗？')))forum.op.deleteReply(${reply.id})">删除</a>
					#if($reply.hide)
					<a href="javascript:forum.op.hideReply(${reply.id}, false)">显示内容</a>
					#else
					<a href="javascript:forum.op.hideReply(${reply.id}, true)">隐藏内容</a>
					#end
					<a href="#">加分</a>
			</div>
			#end
		</div>
		
		<div class="pagination">
		#if($subject.replyCount>0)
			共${subject.replyCount}篇回复
			#if($pagination.pageAmount>1)
			#if(!$pagination.firstPage)
				<a href="?page=1">首页</a>	
				<a href="?page=${pagination.prevPage}">上一页</a>
			#end
			#foreach($p in $pagination.pages)
				#if($pagination.currentPage==$p)
				<span>${p}</span>
				#else
				<a href="?page=${p}">${p}</a>
				#end
			#end
			#if(!$pagination.lastPage)
				<a href="?page=${pagination.nextPage}">下一页</a>
				<a href="?page=${pagination.pageAmount}">尾页</a>
			#end
			#end
		#else
			目前还没有人回复
		#end
		#if($subject.forbidReply)
			,该主题禁止回复
		#end
		</div>

		<a name="reply"></a>
		<div class="topic_form">
			<form id="reply-from" action="$url.base/topic/$subject.id" method="post">
			<table>
				<tr>
					<td style="vertical-align:middle;">内　容:</td>
					<td>
					<div class="editor">
						<textarea id="post_content" cols="40" rows="10" id="topic_content" style="width:550px;height:200px;" name="content"></textarea>
					</div>
					</td>
					<td> </td>
				</tr>
				<tr>
					<td> </td>
					<td>
						<input style="margin-top:25px; padding:0 10px;" type="submit" value="发　表"/>
					</td>
					<td> </td>
				</tr>
			</table>
			</form>
		</div>
	</div>
</div>
#parse("default/_sidebar.htm")
</div>
<div class="clear"></div>
</div>
<script type="text/javascript">
forum.favoritePlug($('span.floor'));
forum.showFloorURL();
forum.showUserInfo();
</script>
#parse("default/_footer.htm")
<script type="text/javascript" src="$url.base/static/xheditor/xheditor-1.1.8-zh-cn.min.js"></script>
<script type="text/javascript" src="$url.base/static/xheditor/xheditor_plugins/ubb.min.js"></script>
<script type="text/javascript">
var editor;
$(pageInit);
function pageInit()
{
	editor= $('#post_content').xheditor({
		skin:'nostyle',
		tools:'Fullscreen,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,Removeformat,|,Align,Img,Emot,Link,Unlink,SelectAll,Pastetext,Source',
		html5Upload:false,
		upImgUrl:"$url.base/xheditor/upload",
		upImgExt:"jpg,jpeg,gif,png",
		showBlocktag:false,
		forcePtag:false,
		beforeSetSource:ubb2html,
		beforeGetSource:html2ubb,
		emotMark:true,
		shortcuts:{'ctrl+enter':submitForm}
	});
}
function submitForm(){$('#reply-from').submit();}
</script>

</body>
</html>